//
//  MyTeamView.m
//  YTwallet
//
//  Created by ZhangLin on 2019/3/21.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "MyTeamView.h"
#import <Masonry.h>
@implementation MyTeamView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews{
    
    self.backgroundColor = [UIColor whiteColor];
    
    self.topView = [[UIView alloc] init];
    UIImage *image = [UIImage imageNamed:@"team_bg"];
    self.topView.layer.contents = (id)image.CGImage;
    [self addSubview:self.topView];
    [self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.mas_equalTo(0);
        make.height.equalTo(self.topView.mas_width).multipliedBy(0.34);
    }];
    
    self.midView = [[UIView alloc] init];
    self.midView.backgroundColor = [UIColor colorWithRed:246 / 255.0 green:248 / 255.0 blue:255 / 255.0 alpha:1];
    [self addSubview:self.midView];
    [self.midView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.topView.mas_bottom);
        make.height.mas_equalTo(46);
    }];
    
    self.nameLab = [[UILabel alloc] init];
    self.nameLab.text = @"姓名(0人)";
    self.nameLab.textColor = [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1];
    self.nameLab.font = [UIFont boldSystemFontOfSize:14];
    [self.midView addSubview:self.nameLab];
    [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.centerY.equalTo(self.midView);
    }];
    
    self.levelLab = [[UILabel alloc] init];
    self.levelLab.text = @"级别";
    self.levelLab.textColor = [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1];
    self.levelLab.font = [UIFont boldSystemFontOfSize:14];
    [self.midView addSubview:self.levelLab];
    [self.levelLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.centerY.equalTo(self.midView);
    }];
    
    self.registeDate = [[UILabel alloc] init];
    self.registeDate.text = @"注册日期";
    self.registeDate.textColor = [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1];
    self.registeDate.font = [UIFont boldSystemFontOfSize:14];
    [self.midView addSubview:self.registeDate];
    [self.registeDate mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self).offset(10);
        make.centerY.equalTo(self.midView);
    }];
    
}

@end
